const ECharts = require('echarts/lib/echarts');
export const optionConfig = (dataX, dataY) => {
    return {
        // backgroundColor: '#011c3a',
        tooltip: {
            trigger: "axis",
            axisPointer: {
                // 坐标轴指示器，坐标轴触发有效
                type: "shadow", // 默认为直线，可选为：'line' | 'shadow'
            },
        },
        xAxis: {
            data: dataX,
            axisLine: {
                lineStyle: {
                    color: '#3d5269'
                }
            },
            axisLabel: {
                color: '#fff',
                fontSize: 14
            }
        },
        yAxis: {
            // name: "单位:次",
            nameTextStyle: {
                color: '#fff',
                fontSize: 10
            },
            axisLine: {
                show: false,
                lineStyle: {
                    color: '#3d5269'
                }
            },
            axisLabel: {
                color: '#fff',
                fontSize: 10
            },
            splitLine: {
                show: false,
                lineStyle: {
                    color: '#2d3d53'
                }
            },
            // interval:100,// 设置y轴的间隔

        },
        grid: {
            top: '15%',
            left: '13%',
            right: '13%',
            bottom: '15%',
            // containLabel: true
        },
        series: [{
            type: 'bar',
            barWidth: 15,
            itemStyle: {
                normal: {
                    color: new ECharts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: '#5ef3ff'
                    }, {
                        offset: 1,
                        color: '#06a4f4'
                    }], false)
                }
            },
            label: {
                normal: {
                    show: true,
                    fontSize: 10,
                    fontWeight: 'bold',
                    color: '#ffffff',
                    position: 'top',
                }
            },
            data: dataY
        }]
    };
}
